//
//  PureColorImageHelper.m
//  jiaYouXueBa
//
//  Created by liuhost on 15/8/31.
//  Copyright (c) 2015年 sunny. All rights reserved.
//

#import "PureColorImageHelper.h"

@implementation PureColorImageHelper
+ (UIImage *)imageWithColor:(NSString *)color
                 withHeight:(NSInteger)height
                  withWidth:(NSInteger)width {
    CGSize imageSize = CGSizeMake(width, height);
    
    UIGraphicsBeginImageContextWithOptions(imageSize, NO, [[UIScreen mainScreen] scale]);
    [[UIColor colorWithHexString:color] set];
    
    UIRectFill(CGRectMake(0, 0, width, height));
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return image;
}
@end
